package com.example.demo.boot.configuration;

import com.example.demo.boot.exception.GlobalExceptionHandler;
import com.example.demo.boot.filter.StreamFilter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
public class FutureAutoConfigure {

    @Bean
    @Order(4)
    @ConditionalOnMissingBean(StreamFilter.class)
    public StreamFilter streamFilter() {
        return new StreamFilter();
    }

    @Bean
    @ConditionalOnMissingBean(GlobalExceptionHandler.class)
    public GlobalExceptionHandler globalExceptionHandler() {
        return new GlobalExceptionHandler();
    }
}
